<script>
	var dodelete='__URL__/dodelete';
	var dogetzsxmobyzsxmid='__URL__/dogetzsxmobyzsxmid';
</script>


<!--wangedit-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/etc/wangEditor-2.1.22/dist/css/wangEditor.min.css">
<!--wangedit-->

<link rel="stylesheet" href="__PUBLIC__/etc/baguetteboxSHIJI/baguettebox.min.css">
<script src="__PUBLIC__/etc/baguetteboxSHIJI/baguettebox.min.js"></script>

<!--table部分-->
<div class='col-md-12'>


  <div class="panel panel-default">
    <div class="panel-heading">收益</div>
    <div class="panel-body">
      <?php 
        $i=0;
        foreach($zhangmu as $k=>$v){
          $i++;
          if($i>5){ break; }
      ?>
        <div class='col-md-2'>【{$k}】{$v}元</div>
      <?php } ?>
      <div><button type="button" class="btn btn-success btn-sm" data-toggle="modal" data-target="#myModal_zhangmu"  id='zhangmu'>查看全部</button></div>
    </div>
  </div>

  <!--#################-->
  
    
  

  <!-- Modal -->
  <div class="modal" id="myModal_zhangmu" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style='padding-top:50px'>
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close close_zhangmu" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title">全部收益</h4>
        </div>
        <div class="modal-body">
          <?php 
            foreach($zhangmu as $k=>$v){
          ?>
            <div class='col-md-4'>【{$k}】{$v}元</div>
          <?php } ?>   
          
          <div class='clearfix'></div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default close_zhangmu" data-dismiss="modal" >关闭</button>
          
        </div>
      </div>
    </div>
  </div>

 <?php if($atho['atha']){ ?><a class='btn btn-primary' href='__URL__/update/id/0'>添加</a><?php } ?><br>
	<!--开始-->
	<table class='table table-hover table-striped table-bordered' id='NBtb' style='margin-top:20px'>
		<thead>
			<tr style="background-color: #337ab7;color:#fff">
				<th>序号</th>
				<volist name='thls' id='thv'>
					<th>{$thv}</th>
				</volist>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name='mls' id='mv'>
				<tr>
					<td>{$pagestart+$i}</td>
					<?php foreach ($mv as $key => $value) {
						if(!in_array($key,$hide_fld)){
					?>
					<?php if($key=='zsxmwa'){ ?>
						<td><a onmouseover="preview(<?php echo $mv[$lowmdmk.'id'] ?>)" href='#'>{$value}</a></td>
					<?php }else if($key=='zsxmquanjietu'){ ?>
            <td><?php if($value){ ?><div class="baguetteBoxOne gallery"><a href="{$value}"><img style='height:80px;width:80px' src="{$value}"></a></div><?php } ?></td>
          <?php }else{ ?>
						<td>{$value}</td>
					<?php } ?>

         
					<?php 
						}
					} ?>
					<td>
					<?php if($atho['athv']){ ?><a class='btn btn-success btn-sm' href="__URL__/view/id/<?php echo $mv[$lowmdmk.'id'] ?>">查看</a><?php } ?>
					<?php if($atho['athv']){ ?><a class='btn btn-primary btn-sm' href="#" onclick="copy(<?php echo $mv[$lowmdmk.'id'] ?>)">复制</a><?php } ?>
					<?php if($atho['athv']){ ?><a class='btn btn-info btn-sm' href="__URL__/liucheng/id/<?php echo $mv[$lowmdmk.'id'] ?>">流程</a><?php } ?>
					<?php if($atho['athm']){ ?><a class='btn btn-warning btn-sm' href="__URL__/update/id/<?php echo $mv[$lowmdmk.'id'] ?>">修改</a><?php } ?>
					<?php if($atho['athd']){ ?><a class='btn btn-danger btn-sm' onclick="dlt(<?php echo $mv[$lowmdmk.'id'] ?>)" >删除</a><?php } ?>
					</td>
				</tr>
			</volist>
			
		</tbody>
	</table>
	
	<!--结束-->
	{$page}
	<br><br><?php if($atho['atha']){ ?><a class='btn btn-primary' href='__URL__/update/id/0'>添加</a><?php } ?>
</div>


<script type="text/javascript">
baguetteBox.run('.baguetteBoxOne', {
    animation: 'fadeIn',
});
</script>

<script type="text/javascript">

</script>
<script type="text/javascript">$("#NBtb thead").smartFloatTB();</script>
<script type="text/javascript">
function dlt(id){
	if(confirm("{$deleteconfirm}")){
		$.ajax({
            'type': 'GET',
            'url':dodelete,
            'async':false,  
            'contentType': 'application/json',
            'data': {'id':id},
            'dataType': 'json',
            'success': function(data) {
            	msg('删除成功！',1);
            	console.log("success");
            },
            'error':function() {
                console.log("error");
            }
        });
	}
}
</script>


<!--#################-->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal_clipboard" style='display: none' id='clipboard'>
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal" id="myModal_clipboard" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" style='padding-top:50px'>
    <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close close_clipboard" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <h4 class="modal-title">剪切板</h4>
    </div>
      <div class="modal-body">
      	      	
        <div  id='editor-clipboard' style="height:500px" ></div>
        
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-success" id='fuzhi' >复制</button>
        <button type="button" class="btn btn-default close_clipboard" data-dismiss="modal" >关闭</button>
        
      </div>
    </div>
  </div>
</div>

<!--wangedit-->
<script type="text/javascript" src="__PUBLIC__/etc/wangEditor-2.1.22/dist/js/wangEditor.js"></script>
<script type="text/javascript">
var editor_clipboard=new wangEditor('editor-clipboard');

// 普通的自定义菜单
editor_clipboard.config.menus = [
    'source',
    '|',     // '|' 是菜单组的分割线
    'bold',
    'underline',
    'italic',
    'strikethrough',
    'eraser',
    'forecolor',
    'bgcolor'
 ];

editor_clipboard.create();
</script>
<!--wangedit-->
<script>
$(function(){
  $('#fuzhi').click(function(){

    alert(editor_clipboard.$txt.html());
  
  })
})
</script>

<script>
function copy(id){
	$('#editor-clipboard').html("");
	$.ajax({
        'type': 'GET',
        'url':dogetzsxmobyzsxmid,
        'async':false,  
        'contentType': 'application/json',
        'data': {'id':id},
        'dataType': 'json',
        'success': function(data) {
        	var zsxmo=data['zsxmo'];
        	var str=zsxmo['zsxmwa'];
        	$('#editor-clipboard').html(str);

        	$('#clipboard').trigger('click');
        	console.log("success");
        },
        'error':function() {
            console.log("error");
        }
    });
	
}

</script>

<!--#################-->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal_preview" style='display: none' id='preview'>
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal" id="myModal_preview" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" style='padding-top:50px' id='previewdialog'>
    <div class="modal-content" id='previewcontent'>
      <div class="modal-header">
      <button type="button" class="close close_preview" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <h4 class="modal-title">预览</h4>
    </div>
      <div class="modal-body">
      	      	
        <div  id='previewctt' style="min-height:500px" ></div>
        
      </div>
      <div class="modal-footer">
        <!--<button type="button" class="btn btn-success" id="copy_preview" >复制</button>-->
        <button type="button" class="btn btn-default close_preview" data-dismiss="modal" >关闭</button>
        
      </div>
    </div>
  </div>
</div>

<script>
function preview(id){
	$('#editor-clipboard').html("");
	$.ajax({
        'type': 'GET',
        'url':dogetzsxmobyzsxmid,
        'async':false,  
        'contentType': 'application/json',
        'data': {'id':id},
        'dataType': 'json',
        'success': function(data) {
        	var zsxmo=data['zsxmo'];
        	var str=zsxmo['zsxmwa'];
          str=str.replace(/<img/, "<img style='width:100%'");
        	$('#previewctt').html(str);

        	$('#preview').trigger('click');
        	console.log("success");
        },
        'error':function() {
            console.log("error");
        }
    });
	
}


$(function(){
	$('#previewcontent').mouseleave(function(){
		$('.close_preview').trigger('click');
	})

  $('#copy_preview').click(function(){
    $('#fe_text').html($('#previewctt').text());
    $('#d_clip_button').trigger('click');
  })

})



</script>


<!--#################-->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal_previewquanjietu" style='display: none' id='previewquanjietu'>
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal" id="myModal_previewquanjietu" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" style='padding-top:50px' id='previewquanjietudialog'>
    <div class="modal-content" id='previewcontent'>
      <div class="modal-header">
      <button type="button" class="close close_preview" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <h4 class="modal-title">预览券截图</h4>
    </div>
      <div class="modal-body">
                
        <div  id='previewquanjietuctt' ></div>
        
      </div>
      <div class="modal-footer">
        <!--<button type="button" class="btn btn-success" id="copy_preview" >复制</button>-->
        <button type="button" class="btn btn-default close_previewquanjietu" data-dismiss="modal" >关闭</button>
        
      </div>
    </div>
  </div>
</div>

<script>
function previewquanjietu(picaddr){
  $('#previewquanjietuctt').html("<img style='width:100%' src='"+picaddr+"'>");

  $('#previewquanjietu').trigger('click');
  
  
}

</script>
<!--
<div class="demo-area">
  <button id="d_clip_button" class="my_clip_button" title="Click me to copy to clipboard." data-clipboard-target="fe_text" data-clipboard-text="Default clipboard text from attribute"><b>Copy To Clipboard...</b></button>
  <h4><label for="fe_text">Change Copy Text Here</label></h4>
  <textarea id="fe_text"  cols="50" rows="3"></textarea>
</div>
<h4>Debug Console:</h4>
<div id="d_debug"></div>
<script type="text/javascript" src="__PUBLIC__/etc/ZeroClipboarddemo/ZeroClipboard.min.js"></script>
<script language="JavaScript">
var swf_file='__PUBLIC__/etc/ZeroClipboarddemo/ZeroClipboard.swf';
$(document).ready(function() {
var clip = new ZeroClipboard($("#d_clip_button"), {
  moviePath: swf_file
});

clip.on('load', function (client) {
  debugstr("Flash movie loaded and ready.");
});

clip.on('noFlash', function (client) {
  $(".demo-area").hide();
  debugstr("Your browser has no Flash.");
});

clip.on('wrongFlash', function (client, args) {
  $(".demo-area").hide();
  debugstr("Flash 10.0.0+ is required but you are running Flash " + args.flashVersion.replace(/,/g, "."));
});

clip.on('complete', function (client, args) {
  debugstr("Copied text to clipboard: " + args.text);
});

// jquery stuff (optional)
function debugstr(text) {
  $("#d_debug").append($("<p>").text(text));
}

});

</script>

<script>
$(function(){
  // $("#copy_preview").mouseup(function(e){ 
  //   if(window.getSelection) { 
  //   var textObj = document.getElementById("previewctt"); 
  //   var selectedText = window.getSelection().toString(); 
  //   alert(selectedText); 
  //   selectedText = "<span style='background:red'>"+selectedText+"</span>"; 

  //   var start = window.getSelection().anchorOffset; 
  //   var end = window.getSelection().focusOffset; 

  //   var tempStr1 = textObj.innerHTML.substring(0,start); 
  //   var tempStr2 = textObj.innerHTML.substring(end); 

  //   document.getElementById("content").innerHTML = tempStr1 + selectedText + tempStr2 ; 

  //   } 


  // }); 
})
</script>
-->